package com.example.baseapp.adpter

import androidx.annotation.LayoutRes
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.baseapp.R
import com.example.baseapp.constants.KeyWords
import com.example.baseapp.entry.TestBean
import com.example.baseapp.topmethod.firstWordUpCase

class TestAdapter(@LayoutRes layout: Int = R.layout.test_item, data: MutableList<TestBean>) :
    BaseQuickAdapter<TestBean, BaseViewHolder>(layout, data) {
    override fun convert(helper: BaseViewHolder?, item: TestBean?) {
        helper?.let {
            it.setText(R.id.tv_name, (item?.keyWordsEnum as KeyWords).keyWord)
                .setText(R.id.tv_keyWords, item.keyWordsEnum.KeyTag?.firstWordUpCase())
                .setText(R.id.tv_subTitle, item.keyWordsEnum.subTitle)
        }
    }
}

